import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import {resolve} from 'path'

// https://vitejs.dev/config/
export default defineConfig({
  plugins: [
    vue(),
  ],
  server:{
    host:'localhost',
    port:8050,
    proxy:{
      "/api":{
        target:"http://localhost:8090",
        changeOrigin: true,
      }
    }
  },
  resolve:{
    alias:{
      '@':resolve(__dirname,'src')
    },
    extensions:[".ts",".js",".jsx",".tsx",".json"]
  },
  css: {
    //css预处理
    preprocessorOptions: {
      /*
				引入var.scss全局预定义变量，
				如果引入多个文件，
				可以使用
				'@import "@/assets/scss/globalVariable1.scss";@import "@/assets/scss/globalVariable2.scss";'
				这种格式
				 */
      scss: {
        additionalData: `@import "@/assets/style/index.scss";`
      }
    }
  }
})
